| Conditions | 3 |
| Paths | 2 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | /** global: GLSR, site_reviews, x */ |
||
| 12 | onClick: function( ev ) { |
||
| 13 | var post_id = ev.target.href.match(/post=([0-9]+)/); |
||
| 14 | var status = ev.target.href.match(/action=([a-z]+)/); |
||
| 15 | if( post_id === null || status === null )return; |
||
| 16 | var request = { |
||
| 17 | action: 'change-review-status', |
||
| 18 | nonce: site_reviews.status_nonce, |
||
| 19 | post_id: post_id[1], |
||
| 20 | status: status[1], |
||
| 21 | }; |
||
| 22 | GLSR.postAjax( ev, request, function( response ) { |
||
| 23 | if( !response.class )return; |
||
| 24 | var el = x( ev.target ); |
||
| 25 | el.closest( 'tr' ).removeClass( 'status-pending status-publish' ).addClass( response.class ); |
||
| 26 | el.closest( 'td.column-title' ).find( 'strong' ).html( response.link ); |
||
| 27 | }); |
||
| 28 | }, |
||
| 29 | }; |
||
| 30 |